
 
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>layout 后台大布局 - Layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  
  <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/res/css/layui-reset.css">
  <link rel="stylesheet" href="/res/css/admin.css">
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">layui 后台布局</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="/">控制台</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
          贤心
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">退了</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black layui-hide-xs">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="tplay-menu layui-nav layui-nav-tree" >

{foreach $navs[0] as $r}
    {if isset($navs[$r['id']])}
        <li class="layui-nav-item layui-nav-itemed">
            <a class="" href="javascript:;">{$r.name}</a>
            <dl class="layui-nav-child">
                {foreach $navs[$r['id']] as $rr}
                <dd><a href="{if $rr.href}{$rr.href}{else}#/nav/show/id/{$rr.id}{/if}">{$rr.name}</a></dd>
                {/foreach}
            </dl>
        </li>
        {else}
        <li class="layui-nav-item"><a href="{if $r.href}{$r.href}{else}#/nav/show/id/{$r.id}{/if}">{$r.name}</a></li>
    {/if}
{/foreach}




      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div id="tp-main" style="padding: 15px;">
  </div>
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script type="text/javascript" src="/static/ue/ueditor.config.js"></script>
<script type="text/javascript" src="/static/ue/ueditor.all.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
//JavaScript代码区域
layui.use('element', function(){
    var $ = layui.$;
    function router(){
        var href = window.location.href;

        var splitHref = href.split('#');
        var u = splitHref.length>1?splitHref.pop():'/';
        if(u=='/') u='/index/index';
        
        $.ajax({
            url:u,
            type:"GET",
            dataType:"html",
            success:function(d){
                $("#tp-main").html(d);
            }
        });
        $(".tplay-menu a").removeClass('active');
   
        $(".tplay-menu").find("a[href='#"+u+"']").parent().addClass("layui-this");
    }
    router();
    $(window).bind('hashchange', function() {
        router();
    });
});
</script>
</body>
</html>
